#include <stdio.h>

//---------------------------------------------------------------------------------
void print_hexbytes(unsigned char *byte_pointer, unsigned char length)
{
	unsigned char i;

	for (i = 0 ; i < length ; i++)
	{
		//newline and address offset if multiple of 8
		if (i%8 == 0) printf("\n0x%02x: ", i);
		//print byte value in hex with leading zeros
		printf("%02x ", *byte_pointer++);
	}
	printf("\n");
}

